package com.back.campus_back.mapper;

import com.back.campus_back.domain.Collect;
import com.back.campus_back.domain.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2021-04-17
 */
@Mapper
@Repository // 代表持久层
public interface CollectMapper extends BaseMapper<Collect> {

    //查看收藏商品的信息
    public List<Goods> findAllCollect(@Param(value = "u_id")int u_id);

    //个人添加收藏商品
    public int collectGoods(@Param(value = "u_id")int u_id, @Param(value = "g_id")int g_id);


    //个人删除收藏商品
    public int cancelCollect(@Param(value = "u_id")int u_id,@Param(value = "g_id")int g_id);


}
